import { get, post } from './index'

//引入nodeAPI


//==========菜单接口=========
//菜单列表
export const menuList = () => get('/menulist?istree=true')

//菜单添加
export const menuAdd = params => post('/menuadd', params)

//菜单一条数据删除
export const menuDelete = params => post('menudelete', params)

//菜单一条数据详情 
export const menuInfo = params => get('/menuinfo', params)

//菜单修改
export const menuEdit = params => post('/menuedit', params)


//===========角色接口
//角色列表
export const roleList = () => get('/rolelist')


//角色添加
export const roleAdd = params => post('/roleadd', params)


//角色一条数据删除
export const roleDelete = params => post('/roledelete', params)


//角色一条数据的详情
export const roleInfo = params => get('/roleinfo', params)


//角色修改
export const roleEdit = params => post('/roleedit', params)


//===============管理员接口
//管理员列表（分页）
export const userList = params => get('/userlist', params)


//管理员添加
export const userAdd = params => post('/useradd', params)



//管理员一条数据删除
export const userDelete = params => post('/userdelete', params)


//管理员一条数据详情
export const userInfo = params => get('/userinfo', params)



//管理员修改
export const userEdit = params => post('/useredit', params)


//管理员总条数
export const getCount = () => get('/usercount')


//管理员登录
export const userLogin = params => post('/userlogin', params)


//=========封装分类接口
//分类添加
export const addCate = params => post("/cateadd", params,true);


//分类编辑
export const postEditCate = params => post("/cateedit", params,true);

//分类单条删除
export const deleteCate = params => post("/catedelete", params);

//分类列表
export const getCateList = params => get("/catelist", { istree: true })

//分类单条查询
export const getCateInfo = params => get("/cateinfo", params)

//==============商品规格管理接口
//商品规格添加
export const getSpecsAdd = params =>post("/specsadd", params);

//商品规格列表
export const getSpecsList = params =>get("/specslist",params)

//商品规格列表获取（一条）
export const getSpecsInfo = params =>get("/specsinfo", params)

//商品规格修改
export const getSpecsEdit = params => post("/specsedit", params)

//商品规格删除
export const getSpecsDelete = params =>post("/specsdelete", params)

//商品规格总数(用于计算分页)
export const getSpecsCount = () =>get("/specscount");



//=========商品管理接口
//商品管理添加
export const getGoodsAdd = params => post("/goodsadd", params,true)

//商品管理列表
export const getGoodsList = params =>get("/goodslist",params)

//商品管理获取（一条）
export const getGoodsInfo = params => get("/goodsinfo",params)

//商品管理修改
export const getGoodsEdit = params =>post("/goodsedit", params,true)

//商品管理删除
export const getGoodsDelete = params =>post("/goodsdelete", params);

//商品管理总数（用于计算分页)
export const getGoodsCount = () => get("/goodscount");

//==========轮播图管理
//轮播图添加
export const bannerAdd = params=>post('/banneradd',params,true)
//获取轮播图列表
export const getBannerList = () =>get('/bannerlist')
//轮播图获取（一条）
export const getBannerInfo = params=>get('/bannerinfo',params)
//轮播图修改
export const getBannerEdit = params=>post('/banneredit',params)
//轮播图删除
export const getBannerDelete = params =>post('/bannerdelete',params)
//===========限时秒杀
//限时秒杀添加
export const seckAdd = params =>post('/seckadd',params)
//限时秒杀列表
export const getSeckList =()=>get('/secklist')
//限时秒杀获取（一条）
export const getSeckInfo = params=>get('/seckinfo',params)
//限时秒杀修改
export const seckEdit = params => post('/seckedit',params)
//限时秒杀删除
export const seckDelete = params => post('/seckdelete',params)
//===========会员管理
//会员列表
export const memberlist = ()=>get('/memberlist')
//会员获取(一条)
export const memberinfo = params => get('/memberinfo',params)
//全员修改
export const memberedit = params => post('/memberedit',params)